package com.zsk.shop.enums;

//0未知/1苹果/2安卓/3页面/4小程序
public enum EnumLoginPlatform {
    NULL("未知", 0),
    IOS("苹果", 1),
    ANDROID("安卓", 2),
    PAGE("页面", 3),
    MINI("小程序", 4),
    ;

    String name;
    Integer code;

    public static String getNameByCode(Integer code) {
        EnumLoginPlatform[] enums = EnumLoginPlatform.values();
        for (int i = 0; i < enums.length; i++) {
            if (enums[i].getCode().equals(code)) {
                return enums[i].getName();
            }
        }
        return "";
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    EnumLoginPlatform(String name, Integer code) {
        this.name = name;
        this.code = code;
    }
}
